﻿using LibNiconico.NiconicoApi;
using LibNiconico.NiconicoApi.Alert;
using LibNiconico.NiconicoApi.Lives;
using LibNiconico.NiconicoApi.Lives.Broadcast;
using LibNiconico.NiconicoApi.PlayerStatus;
using LibNiconico.NiconicoApi.User.Thumb;
using LibNiconico.NiconicoApi.Utils;
using NicoView.Model.Service.Broadcast;
using NicoView.Model.Service.Events;
using NicoView.Model.Service.Lives;
using NicoView.Model.Service.Results;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace NicoView.Model.Service
{
    /// <summary>
    /// ニコニコサービスを提供するオブジェクト
    /// </summary>
    public class NicoServiceProvider
    {

        /// <summary>
        /// ニコニコへの認証失敗時に呼び出されるデリゲート
        /// </summary>
        /// <param name="args"></param>
        public delegate void NicoFailAuth(NicoServiceRequieSetEventArgs args);


        private NotificationNicoSelfUser selfUser;
        public NotificationNicoSelfUser SelfUser
        {
            get
            {
                return this.selfUser;
            }

            set
            {
                this.selfUser = value;

                if (this.selfUser != null)
                {
                    this.selfUser.PropertyChanged += onSelfUserPropertyChanged;
                }
            }
        }


        /// <summary>
        /// 割り当てられている自身のユーザ情報が変更されたときに呼び出されるハンドラ
        /// </summary>
        public event PropertyChangedEventHandler SelfUserPropertyChanged;


        private void onSelfUserPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (this.SelfUserPropertyChanged != null) this.SelfUserPropertyChanged(selfUser, e);
        }

        

        

        /// <summary>
        /// このプロバイダを生成したにこびゅアプリケーション
        /// </summary>
        private NicoViewApplication baseApplication;





        


        


        



        

        


       


        



        

        

        public NicoServiceProvider() : this(NicoViewApplication.Current) { }

        public NicoServiceProvider(NicoViewApplication provider)
        {

            
            baseApplication = provider;
        }
    }
}
